package com.xpgk.mvc.statistic.unusedProductCustomersStatistic;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import com.xpgk.mvc.base.BaseController;
import com.xpgk.mvc.codeSet.Code;
import com.xpgk.mvc.productSet.Product;
import com.xpgk.mvc.statistic.customerProductPurchaseAndSaleStatisic.CustomerProductPurchaseAndSaleStatisicSQL;
import com.xpgk.tools.ToolDateTime;

public class UnusedProductCustomersStatisticController extends BaseController{

	public void index() {
		setAttr("startTime", ToolDateTime.getMonthOneDay(new Date()));
		render("unusedProductCustomersStatistic.html");
	}
	
	/**
	 * 未使用产品顾客列表
	 */
	public void view(){
	
		String organIds = (String) splitPage.getQueryParam().get("organIds");
		String startTime = (String)splitPage.getQueryParam().get("startTime");
		String endTime = (String)splitPage.getQueryParam().get("endTime");
		String customerName = (String)splitPage.getQueryParam().get("customerName");
		String treatment = (String)splitPage.getQueryParam().get("treatment");
		
		splitPage.getQueryParam().put("startTime", startTime);
		splitPage.getQueryParam().put("endTime", endTime);
		splitPage.getQueryParam().put("customerName", customerName);
		splitPage.getQueryParam().put("treatment", treatment);
		if (organIds==null||organIds=="") {
			System.out.println(getCUserOrganIds()+startTime+endTime+customerName+treatment);
			splitPage.getQueryParam().put("organIds", getCUserOrganIds());
		}else{
			splitPage.getQueryParam().put("organIds", organIds);
		}
		
		System.out.println(organIds+startTime+endTime+customerName+treatment);
		
		String json = paging(splitPage, UnusedProductCustomersStatisticSQL.sqlId_splitPageSelect, UnusedProductCustomersStatisticSQL.sqlId_splitPageFrom);
		
		renderJson(json);

		}	
	
}
